package com.pay.service.inter;

import com.alipay.api.AlipayApiException;
import com.pay.model.interface_parameter.AliPayQueryParam;

import java.util.Map;


/**
 * 阿里支付 service
 *
 * @author MENG
 * @version 2018/7/4
 * @see
 */
public interface AlipayService
{

    /**
     * 阿里支付  扫码支付
     *
     * @param appId  //appid
     * @param merchantPrivateKey  //私钥
     * @param notifyUrl  //回调
     * @param outTradeNo  //商户订单号
     * @param totalAmount  //付款金额
     * @param subject       //订单名称
     * @param qrpayouttime
     * @return ResultPay
     */
    Map<String,Object> scanPay(String appId, String merchantPrivateKey,
                               String notifyUrl, String outTradeNo, String totalAmount, String subject, String qrpayouttime);

    /**
     * 阿里支付  付款码支付
     *
     * @param appId
     * @param merchantPrivateKey
     * @param notifyUrl
     * @param outTradeNo
     * @param authCode
     * @param subject
     * @param discountAmount
     * @param qrpayouttime
     * @return
     */
    Map<String,Object> alipayCode(String appId, String merchantPrivateKey,
                                  String notifyUrl, String outTradeNo, String authCode,
                                  String subject, String discountAmount, String qrpayouttime);

    /**
     * 阿里支付 退款
     *
     * @param app_id
     * @param merchant_private_key
     * @param notifyUrl
     * @param outTradeNo
     * @param refoundAmount
     * @return
     */
    Map<String,Object> alipayRefund(String app_id, String merchant_private_key,
                      String notifyUrl, String outTradeNo, String refoundAmount);

    /**
     * 阿里支付 手机H5
     *
     * @param appId
     * @param privateKey
     * @param notifyUrl
     * @param orderNo
     * @param subject
     * @param totalAmount
     * @param timeoutExpress
     * @param returnUrl
     * @return
     */
    Map<String,Object> alipayMobileWeb(String appId, String privateKey,
                                       String notifyUrl,
                                       String orderNo, String subject,
                                       String totalAmount,
                                       String timeoutExpress, String returnUrl);

    /**
     * PC 支付
     *
     * @param appId
     * @param privateKey
     * @param notifyUrl
     * @param orderNo
     * @param totalAmount
     * @param subject
     * @param qrCodeTimeoutExpress
     * @param returnUrl
     * @return
     */
    Map<String,Object> getAliPayPcPagePay(String appId, String privateKey,
                                          String notifyUrl,
                                          String orderNo, String totalAmount, String subject,
                                          String qrCodeTimeoutExpress, String returnUrl);

    /**
     * 查询支付状态
     * @param aliPayQueryParam
     * @return
     */
    Map<String,Object> aliPayQuery(AliPayQueryParam aliPayQueryParam) throws AlipayApiException;

    /**
     * 阿里部分支付
     *
     * @param appId
     * @param privateKey
     * @param orderNo
     * @param refundAmount
     * @param refundReason
     * @param totalAmount
     * @param sunOrderCode
     * @return
     */
    Map<String,Object> aliPayRebate(String appId, String privateKey, String orderNo, String refundAmount,
                      String refundReason, String totalAmount, String sunOrderCode);
}
